
# 设置cookie
from flask import Flask, make_response, request


app = Flask(__name__)


@app.route('/')
def index():
    response = make_response('<h1>Hello world!</h1>')
    response.set_cookie('key','value')
    return response


@app.route('/get_cookie')
def get_cookie():
    key = request.cookies.get('key')
    return key
